cmake_minimum_required(VERSION 3.13)

set(LIB_NAME "bluetoothtranslib")
project(${LIB_NAME})

aux_source_directory(${PROJECT_SOURCE_DIR} ${LIB_NAME}Src)
add_library(${LIB_NAME} STATIC ${${LIB_NAME}Src})

target_include_directories(${LIB_NAME} PUBLIC
    ${PROJECT_SOURCE_DIR}
    ${MODULEMANAGEMENT_HEADER_DIR}
    ${MODULES_HEADER_DIR}/PublicHeader
    ${CMAKE_BINARY_DIR}/Proto
    ${THIRD_LIB_DIR}/protobuf/include

    # xnet
    ${top_dir}/Platform/navossdk/${PLATFORM}/include
    ${top_dir}/Platform/navossdk/${PLATFORM}/include/exception
    ${top_dir}/Platform/navossdk/${PLATFORM}/include/service
    ${top_dir}/Platform/navossdk/${PLATFORM}/include/communication
    ${top_dir}/Platform/navossdk/${PLATFORM}/include/communication/service
    ${top_dir}/Platform/navossdk/${PLATFORM}/include/datacenter
    )

target_link_directories(${LIB_NAME} PUBLIC
    ${THIRD_LIB_DIR}/protobuf/lib
    ${THIRD_LIB_DIR}/openssl/lib

    #xnet
    ${top_dir}/Platform/navossdk/${PLATFORM}/lib
    )


target_link_libraries(${LIB_NAME}
        commonlib functionallib xnetcommlib datacenterlib cloudloglib serialportlib 

        # xnet
        libnav_os.a libhiredis.a libuuid.a
#        librtps.a libfastrtps.a libfastcdr.a libfoonathan_memory-0.7.1.a libtinyxml2.a
        
        protobuf proto libssl.a libcrypto.a pthread rt
        stdc++fs
    )

target_compile_definitions(${LIB_NAME} PRIVATE ${APP_DEFIN})

message("** PROTOBUF DIR == ${PROTOBUF_INCLUDE_DIRS}")

install(TARGETS ${LIB_NAME} DESTINATION ${KAPOK_INSTALL_LIB_DIR})
